#include "dataprinter.h"

DataPrinter::DataPrinter(QObject *parent)
    : QObject{parent}
{

}

void DataPrinter::doDataPtinter()
{
    try{
        if(!printer_queue.isEmpty()){
            //消息窗口与打印机绑定
            QPrinter *printer = printer_queue.dequeue();
            QPrintDialog dialog(printer);

            //选择打印选项
            if(dialog.exec() == QDialog::Accepted)
            {
                //打印信息

            }
        }

    }
    catch (std::exception &e) {
        qWarning()<<"DataPrinter:doDataPtinter()    "<<e.what();
    }
}
